f5be3ceea96d049cb8f841a479f609c0f54553c9,plugins/org.eclipse.xtext.generator/src/org/eclipse/xtext/generator/GenModelAccess.java,GenModelAccess,getGenPackage,#EPackage#,77

Before Change


		URI genModelURI = EcorePlugin.getEPackageNsURIToGenModelLocationMap().get(pkg.getNsURI());
		if (genModelURI == null)
			throw new RuntimeException("No GenModel for EPackage '" + pkg.getNsURI() + "' is registered.");
		Resource genModelResource = pkg.eResource().getResourceSet().getResource(genModelURI, true);
		if (genModelResource == null)
			throw new RuntimeException("Error loading GenModel " + genModelURI);
		for (EObject model : genModelResource.getContents())

After Change


		URI genModelURI = EcorePlugin.getEPackageNsURIToGenModelLocationMap().get(pkg.getNsURI());
		if (genModelURI == null)
			throw new RuntimeException("No GenModel for EPackage '" + pkg.getNsURI() + "' is registered.");
		ResourceSet resourceSet = pkg.eResource().getResourceSet();
		if (resourceSet == null)
			throw new RuntimeException("There is no ResourceSet for EPackage '" + pkg.getNsURI() + "'. "
					+ "Please make sure the EPackage has been loaded from a .ecore file "